//
//  GAKKIFeatureCollectionViewConfiguration.h
//  GANGAIKit
//
//  Created by fh on 2019/11/8.
//  Copyright © 2019 cashchina. All rights reserved.
//


#import "GAKKIBaseModel.h"
#import <UIKit/UIKit.h>

/**
 默认布局属性配置的优先级::FlowLayoutDefaultLayoutEachColumnOrLineCountPriorityHigh优先确保列数跟设置的属性一致,cell宽度自动适配; FlowLayoutDefaultLayoutEachColumnOrLineCountPriorityLow优先确保cell的size跟设置的属性一致,行数或者列数自动适配.

 - FlowLayoutDefaultLayoutEachColumnOrLineCountPriorityHigh: 布局按照设置的defaultLayoutColumnCount或者defaultLayoutLineCount属性配置
 - FlowLayoutDefaultLayoutEachColumnOrLineCountPriorityLow: 布局按照设置的defaultLayoutItemWidth和defaultLayoutItemHeight属性配置
 */
typedef NS_ENUM(NSInteger, FlowLayoutDefaultLayoutEachColumnOrLineCountPriority) {
    FlowLayoutDefaultLayoutEachColumnOrLineCountPriorityHigh = 0,
    FlowLayoutDefaultLayoutEachColumnOrLineCountPriorityLow
};

NS_ASSUME_NONNULL_BEGIN

/// 自定义适配布局的集合视图控件的配置模型
@interface GAKKIFeatureCollectionViewConfiguration : GAKKIBaseModel

/// 默认布局collectionView分区边距
@property (nonatomic, readwrite, assign) UIEdgeInsets sectionInset;
/// 默认布局滚动方向:采用系统布局时 default is UICollectionViewScrollDirectionVertical
@property (nonatomic, readwrite, assign) UICollectionViewScrollDirection scrollDirection;
/// 默认布局属性设置优先级
@property (nonatomic, readwrite, assign) FlowLayoutDefaultLayoutEachColumnOrLineCountPriority defaultLayoutEachColumnOrLineCountPriority;
/// 默认布局的列间距
@property (nonatomic, readwrite, assign) CGFloat defaultLayoutColumnSpace;
/// 默认布局的列数:受滚动方向的影响
@property (nonatomic, readwrite, assign) NSInteger defaultLayoutColumnCount;
/// 默认布局的cell高, 默认跟宽度一样
@property (nonatomic, readwrite, assign) CGFloat defaultLayoutItemHeight;
/// 默认布局的行间距
@property (nonatomic, readwrite, assign) CGFloat defaultLayoutLineSpace;
/// 默认布局的行数:受滚动方向的影响
@property (nonatomic, readwrite, assign) NSInteger defaultLayoutLineCount;
/// 默认布局的cell宽, 默认跟高度一样
@property (nonatomic, readwrite, assign) CGFloat defaultLayoutItemWidth;

/// cell的宽高比例:默认1:1,FlowLayoutDefaultLayoutEachColumnOrLineCountPriorityHigh模式下且shouldFitItemSizeWHScale值为YES时有效
@property (nonatomic, readwrite, assign) CGFloat itemSizeWHScale;
/// 是否设置cell的宽高比例
@property (nonatomic, readwrite, assign) BOOL shouldFitItemSizeWHScale;

/// 当使用默认系统布局的时候是否使用默认的item高度,默认跟宽度一样
@property (nonatomic, readonly, assign) BOOL shouldUseDefaultLayoutItemHeight;
/// 当使用默认系统布局的时候是否使用默认的item宽度,默认跟高度一样
@property (nonatomic, readonly, assign) BOOL shouldUseDefaultLayoutItemWidth;

/// collectionView 的布局，不赋值的话默认是 UICollectionViewFlowLayout,自定义布局需要重写delegate方法
@property (nonatomic, readwrite, strong) UICollectionViewLayout *collectionViewLayout;
/// 内部默认使用布局:外部没有设置布局属性的时候使用
@property (nonatomic, readonly, strong) UICollectionViewFlowLayout *systemDefaultLayout;

/// 默认的配置
+ (instancetype)configuration;

@end

NS_ASSUME_NONNULL_END
